{include file="public/header296" /}
<div class="layui-fluid">
  <div class="layui-card">
    <div class="layui-card-body">
      <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" >
        <div class="layui-upload" id="upload-thumb">
          <label class="layui-form-label">头像</label>
          <div class="layui-upload-list">

            <img class="layui-upload-img" id="demo1" width="150" height="150" {notempty name="$item.avatar"}src="{$item.avatar}"{/notempty} >
          </div>
          <label class="layui-form-label"></label>
          <p id="demoText"></p>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">昵称</label>
          <div class="layui-input-inline">
            <input type="text" value="{$item.nickname}" disabled class="layui-input" style="border: none" />
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">ID</label>
            <div class="layui-input-inline">
              <input type="tel" value="{$item.user_id}" disabled class="layui-input" style="border: none" />
            </div>
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">性别</label>
          <div class="layui-input-block">
            <input type="checkbox" title="男" lay-skin="primary" {if $item['gender'] == 1} checked {else/} disabled {/if} />
            <input type="checkbox" title="女" lay-skin="primary" {if $item['gender'] == 2} checked {else/} disabled {/if} />
            <input type="checkbox" title="未知" lay-skin="primary" {if $item['gender'] == 0} checked {else/} disabled {/if} />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">手机</label>
          <div class="layui-input-inline">
            <input type="text" value="{$item.mobile}" disabled class="layui-input" style="border: none" />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">账户余额(元)</label>
          <div class="layui-input-inline">
            <input type="text" value="{$item.balance|default="0"}" disabled class="layui-input" style="border: none" />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">实名状态</label>
          <div class="layui-input-block">
            {if $item['user_idcard_audit'] == 1}
              <input type="button" class="layui-btn layui-btn-primary" value="已认证" />
            {elseif $item['user_idcard_audit'] == 2}
              <input type="button" class="layui-btn layui-btn-danger" value="已拒绝" />
            {elseif $item['user_idcard_audit'] == 0}
              <input type="button" value="审核中" class="layui-btn" />
            {else/}
              <input type="button" value="未认证" class="layui-btn layui-btn-normal" />
            {/if}
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">会员状态</label>
          <div class="layui-input-inline">
            {notempty name="item.user_auth_info"}
              {if $item['user_auth_info']['is_auth']}
                <input type="text" value="{$item['user_auth_info']['auth_expire']}" disabled class="layui-input" style="border: none" />
              {else /}
                <input type="text" value="未认证或已过期" disabled class="layui-input" style="border: none" />
              {/if}
            {/notempty}
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">注册时间</label>
          <div class="layui-input-inline">
            <input type="text" value="{$item.create_time}" class="layui-input" />
          </div>
        </div>
        {/*<div class="layui-form-item">
          <label class="layui-form-label">最后登录</label>
          <div class="layui-input-inline">
            <input type="text" value="" class="layui-input" />
          </div>
        </div>*/}
        {/*<div class="layui-form-item">
          <label class="layui-form-label">登录IP</label>
          <div class="layui-input-inline">
            <input type="text" value="" class="layui-input" />
          </div>
        </div>*/}
        <div class="layui-form-item">
          <label class="layui-form-label">用户状态</label>
          <div class="layui-input-block">
            <input type="checkbox" lay-skin="switch" lay-filter="status" lay-text="正常|封禁" {eq name="item.status" value="1"}checked {/eq} />
          </div>
        </div>
        <div class="layui-form-item layui-hide">
          <input type="hidden" name="id" value="{$item.user_id}" />
          <input type="hidden" name="status" id="status" value="{$item.user_id}" />
          <input type="button" lay-submit lay-filter="Lay-app-form-edit" id="Lay-app-form-edit" value="编辑">
        </div>
      </div>
    </div>
  </div>
</div>
<script>
  layui.use(['layer', 'form', 'laydate'], function(){
    var $ = layui.$
            ,form = layui.form
            ,laydate = layui.laydate;

    // 监听开关事件
    form.on('switch(status)', function(data){
      var x = data.elem.checked;
      if (x==true) {
        $("#status").val(1);
      } else {
        $("#status").val(0);
      }
    });
    //日期选择器
    laydate.render({
      elem: '#test-laydate-type-date'
      //,type: 'date' //type 默认为 date，所以可不填
    });
  })
</script>
</body>
</html>